package cqupt.spark_log.contrant;

import java.util.HashMap;
import java.util.Map;

public class Contant {
	// sort terasort kmeans pagerank
	public static String APP_NAME = "sort";
	
	public static String BASE_PATH = "C:/Users/TomWang/Desktop/学术/spark实验/experiment-test-0101/ENERGY_AWARE_0.0.2-10-1/" + APP_NAME;

	public static double CPU_1 = 375.8550;
	public static double CPU_2 = -401.0088;
	public static double CPU_3 = 164.4327;
	
	public static double MEM_1 = -30.6192;
	public static double MEM_2 = 41.8946;
	public static double MEM_3 = -19.8122;
	
	public static double CON = 155.0537;
	
	//6
	public static String HOST_1 = "172.23.26.171";
	public static double HOST_1_ENERGY = 180000;
	//2
	public static String HOST_2 = "172.23.26.172";
	public static double HOST_2_ENERGY = 60000;
	//1
	public static String HOST_3 = "172.23.26.173";
	public static double HOST_3_ENERGY = 30000;
	//3
	public static String HOST_4 = "172.23.26.175";
	public static double HOST_4_ENERGY = 90000;
	//5
	public static String HOST_5 = "172.23.26.176";
	public static double HOST_5_ENERGY = 150000;
	//4
	public static String HOST_6 = "172.23.26.177";
	public static double HOST_6_ENERGY = 120000;
	
	public static String getExecutorId (String fileName) {
		Map<String, String> map = new HashMap<String, String>();
		map.put("monitor-171", HOST_1);
		map.put("monitor-172", HOST_2);
		map.put("monitor-173", HOST_3);
		map.put("monitor-175", HOST_4);
		map.put("monitor-176", HOST_5);
		map.put("monitor-177", HOST_6);
		return map.get(fileName);
	}
	
	public static double getBaseEnergy (String fileName) {
		Map<String, Double> map = new HashMap<String, Double>();
		map.put("monitor-171", HOST_1_ENERGY);
		map.put("monitor-172", HOST_2_ENERGY);
		map.put("monitor-173", HOST_3_ENERGY);
		map.put("monitor-175", HOST_4_ENERGY);
		map.put("monitor-176", HOST_5_ENERGY);
		map.put("monitor-177", HOST_6_ENERGY);
		return map.get(fileName);
	}
	
	public static String getTitle () {
		StringBuilder stringBuilder = new StringBuilder(",");
		stringBuilder.append(HOST_1);
		stringBuilder.append(",");
		stringBuilder.append(HOST_2);
		stringBuilder.append(",");
		stringBuilder.append(HOST_3);
		stringBuilder.append(",");
		stringBuilder.append(HOST_4);
		stringBuilder.append(",");
		stringBuilder.append(HOST_5);
		stringBuilder.append(",");
		stringBuilder.append(HOST_6);
		return stringBuilder.toString();
	}
}
